package com.monicaca.dao.impl;

import com.monicaca.bean.RKD;
import com.monicaca.dao.RKDDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.support.DataAccessUtils;
import org.springframework.orm.hibernate4.HibernateTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class RKDDAOImpl extends BaseDAOImpl implements RKDDAO{
	@Autowired
	public void setHibernateTemplate(HibernateTemplate hibernateTemplate){
		super.hibernateTemplate = hibernateTemplate;
	}

	public RKD findByName(RKD rkd) {
		return  hibernateTemplate.findByExample(rkd).get(0);
	}
	public  int count2(){
		String sql = "select count(*) from RKD";
		return DataAccessUtils.intResult(hibernateTemplate.find(sql));
	}

}
